package io.renren.modules.blog.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import io.renren.common.service.impl.CrudServiceImpl;
import io.renren.modules.blog.dao.ChannelDao;
import io.renren.modules.blog.dto.ChannelDTO;
import io.renren.modules.blog.entity.ChannelEntity;
import io.renren.modules.blog.service.ChannelService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;

import java.util.Map;

/**
 * 文章分类
 *
 * @author www.jianglongwang.com wangjianglong126@126.com
 * @since 2.0.0 2021-02-13
 */
@Service
public class ChannelServiceImpl extends CrudServiceImpl<ChannelDao, ChannelEntity, ChannelDTO> implements ChannelService {

    @Override
    public QueryWrapper<ChannelEntity> getWrapper(Map<String, Object> params) {
        String id = (String) params.get("id");

        QueryWrapper<ChannelEntity> wrapper = new QueryWrapper<>();
        wrapper.eq(StringUtils.isNotBlank(id), "id", id);

        return wrapper;
    }


}